package games.gong.durid.entity;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Null;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Permission {
    @Null(message = "权限ID必须为空")
    private Long id;

    @NotBlank(message = "权限名不能为空")
    private String name;

    private String description;

    private String resource; // 资源，如"/api/users/**"

    private String action; // 操作，如"read", "write", "delete"

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    // Constructors

    public Permission(Long id, String name, String description, String resource, String action) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.resource = resource;
        this.action = action;
    }

}